<?php

class Cafepress_Service_Action
{
	/**
	 * Conversion method from the standard class returned by the method invocation.
	 *
	 * @param xml $actionXml
	 * @return Core_Service_Etsy_Method
	 */
	public static function fromXml ( $actionXml )
	{
		$returnInstance = new Cafepress_Service_Action();
		$returnInstance->name = (String)$actionXml['name'];
		$returnInstance->comments = (String)$actionXml['comments'];
		
		$paramLen = count($actionXml->parameter);
		for( $i = 0; $i < $paramLen; $i++ )
		{
			$parameter = $actionXml->parameter[$i];
			$returnInstance->params[(String)$parameter['name']] = (String)$parameter['comments'];
		}
		
		return $returnInstance;
	}
	
	/**	 * A descriptive name for the command.	 *	 * @type string	 */	public $name;
	/**	 * Brief text explaining the method.	 *	 * @type string	 */	public $comments;
	/**	 * A hash of param names as keys, and types as values. Valid types are string, int, enum (with values in parentheses) and user_id_or_name.	 *	 * @type hash	 */	public $params = array();
	
}